package com.uvnos4j.matilda.commons.exception;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
 * 自定义服务异常
 * <p>
 * Description:服务异常
 * </p>
 *
 * @author Guo.wl
 * @version v1.0.0
 * @since 2020-03-29 11:11:12
 */
@Slf4j
@Getter
public class ServiceException extends RuntimeException {

    private String code;

    public ServiceException() {
        this(GlobalException.UNDEFINED);
    }

    public ServiceException(IException error) {
        this(error.getCode(), error.getMessage());
    }

    public ServiceException(String code, String message) {
        super(message);
        this.code = code;
    }

}